#!/usr/bin/env python 
# -*- coding:utf-8 -*-

import requests
import os

'''
txt文件必须是utf8编码
'''
with open('proof_income.txt', 'r', encoding='utf-8') as f:
    for line in f:
        list = line.split()
        path = os.getcwd().replace('\\', '/')+'/'+list[1]
        if not os.path.exists(path):
            os.makedirs(path)
        file_path = path+'/'+list[2]
        file_url = list[0]
        print(file_path)
        print(file_url)
        response = requests.get(file_url)
        if response.status_code == 200:
            with open(file_path, 'wb') as fw:
                fw.write(response.content)
            fw.close()
f.close()
